package 面向对象_特征4;

public class 面向对象_3_等于和equals {


    public static void main(String[] args) {
        面向对象_3_等于和equals dx1 = new 面向对象_3_等于和equals();
        面向对象_3_等于和equals dx2 = new 面向对象_3_等于和equals();
        System.out.println(dx1 == dx2);
        System.out.println(dx1.equals(dx2));
        /**
         * == 是比较 两个是否是同一个对象 (地址)
         * equals  表示 实际内容 是否相等
         */

        String dx3 = "abc";
        String dx4 = "abc";
        //String dx3 = new String("abc");
        //String dx4 = new String("abc");
        System.out.println(dx3 == dx4);
        System.out.println(dx3.equals(dx4));



    }
}
